package com.uh.app.controller;

import com.uh.app.service.UserService;
import com.uh.microservice.core.controller.BaseSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@Controller
@RequestMapping("/usr")
public class UserController extends BaseSupport {

	@Autowired
	private UserService service;

	@RequestMapping("/login")
	public @ResponseBody String login(
			@RequestParam(value = "uname", required = false) String uname,
			@RequestParam(value = "pwd", required = false) String pwd
//			@RequestParam(value = "verifyCode", required = false) String verifyCode,
//			Map<String, Object> initData,
//			HttpServletRequest request,
//			HttpServletResponse response) {
	){
		return output(service.doLogin(uname,pwd));
	}
}
